We can't really tell for sure, but I suspect you could do: var q = from be in be. Bills where b. UserName == UserName orderby b.
DueDate select new { b. DueDate, b. Name, b.
PaymentAmount, b. URL }; return q.AsEnumerable() . Select(b => new Bill { DueDate = b.
DueDate, Name = b. Name, PaymentAmount = b. PaymentAmount, URL = b.
URL }) .ToList() In other words, pull the data from the database as anonymous types, but then return a list of "manually created entities" with the relevant properties copied over.
We can't really tell for sure, but I suspect you could do: var q = from be in be. Bills where b. UserName == UserName orderby b.
DueDate select new { b. DueDate, b. Name, b.
PaymentAmount, b. URL }; return q.AsEnumerable() . Select(b => new Bill { DueDate = b.
DueDate, Name = b. Name, PaymentAmount = b. PaymentAmount, URL = b.
URL }) .ToList(); In other words, pull the data from the database as anonymous types, but then return a list of "manually created entities" with the relevant properties copied over.
As @Jon Skeet said, we don't what a Bill looks like, but going from context, to make this work you need: public List GetBills(string UserName) { BillsEntities be = new BillsEntities(); return new List(from be in be. Bills where b. UserName == UserName orderby b.
DueDate select new Bill { DueDate = b. DueDate, Name = b. Name, PaymentAmount = b.
PaymentAmount, Url = b. URL }); } This assumes that the properties you selected mirror the exact properties in your Bill class and that there won't be any null reference exceptions or bad constructor arguments.
The items the select new Bill {...} are not all the properties of Bill. I'm new to entity framework and I'm not really sure how I'm supposed to be moving objects around. – kyle Sep 14 at 15:18 @kyle: Unless you have a specific need for a List you really should be using the IQueryable version of your EF "table".
The List actually creates more work. – Joel Etherton Sep 14 at 15:43.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.